package com.xzm.springboot.controller;

import com.xzm.springboot.domain.Employ;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @author 3052
 * @create 2020-08-09 22:39
 */
@Controller
public class EmployController {

    @Autowired
    JdbcTemplate jdbcTemplate;

    @ResponseBody
    @RequestMapping("/emps")
    public String getEmploy(){

        List<Map<String, Object>> emps = jdbcTemplate.queryForList("select * from employ");
        return String.valueOf(emps);
    }

}
